package com.lightsaber.trade.as.entity.reta;


import com.lightsaber.trade.core.entity.BaseEntity;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Version;

		/**
 * Order.
 */
@Entity
@Table(name="reta_order"
)
public class Order  extends BaseEntity {
	

		
		
    @Version
    @Column(name="version")
		 	private Integer version;
		
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="order_template_id")
		 	private OrderTemplate orderTemplate;
		
		
		
		
		
    
    @Column(name="customer_name", length=20)
		 	private String customerName;
		
    
    @Column(name="description", length=100)
		 	private String description;
		
    
    @Column(name="total_price", precision=22, scale=0)
		 	private Double totalPrice;
		
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="order")
		 	private Set<OrderItem> orderItems = new HashSet<OrderItem>(0);
		   
    
    
			
    public Integer getVersion() {
        return this.version;
    }
    
    public void setVersion(Integer version) {
        this.version = version;
    }
    
    
			
    public OrderTemplate getOrderTemplate() {
        return this.orderTemplate;
    }
    
    public void setOrderTemplate(OrderTemplate orderTemplate) {
        this.orderTemplate = orderTemplate;
    }
    
    
    
    
    
    
			
    public String getCustomerName() {
        return this.customerName;
    }
    
    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }
    
    
			
    public String getDescription() {
        return this.description;
    }
    
    public void setDescription(String description) {
        this.description = description;
    }
    
    
			
    public Double getTotalPrice() {
        return this.totalPrice;
    }
    
    public void setTotalPrice(Double totalPrice) {
        this.totalPrice = totalPrice;
    }
    
    
			
    public Set<OrderItem> getOrderItems() {
        return this.orderItems;
    }
    
    public void setOrderItems(Set<OrderItem> orderItems) {
        this.orderItems = orderItems;
    }
    
	}


